package com.apt.action;

public class MyTestAction extends AptBaseAction {

	private int remainingTime;
	private String yourAnswer;
	private int counter;

	public String first() {

		Integer iTotal = (Integer) session.get("duration");
		System.out.println("Total Time:" + iTotal);
		if (iTotal == null) {
			session.put("duration", 180);
			session.put("first", "true");
			session.put("counter", 0);
		} else {
			addActionError("Init Value of time is not zero");
			return "error";

		}

		return "success";

	}

	public String next() {
		System.out.println("Next:Time from jsp is :" + remainingTime);
		System.out.println("Next:Counter from jsp is :" + counter);

		session.put("duration", remainingTime);
		session.put("first", "false");
		session.put("counter", counter);
		System.out.println("Your Answer:" + yourAnswer);
		return "success";
	}

	public String last() {
		System.out.println("Last:Time from jsp is :" + remainingTime);
		System.out.println("Your Answer:" + yourAnswer);
		return "success";
	}

	public int getRemainingTime() {
		return remainingTime;
	}

	public void setRemainingTime(int remainingTime) {
		this.remainingTime = remainingTime;
	}

	public String getYourAnswer() {
		return yourAnswer;
	}

	public void setYourAnswer(String yourAnswer) {
		this.yourAnswer = yourAnswer;
	}

	public int getCounter() {
		return counter;
	}

	public void setCounter(int counter) {
		this.counter = counter;
	}

	
}
